﻿/*function ajaxFileUpload(){
	$.ajaxFileUpload({
		url:'admin_uploadpic.php',
		secureuri:false,
		fileElementId:'fileToUpload',
		dataType: 'json',
		data:{name:'logan', id:'id'},
		success: function (data, status)
		{
			if(typeof(data.error) != 'undefined')
			{
				if(data.error != '')
				{
					alert(data.error);
				}else
				{
					imgurl=data.url;
					alert(imgurl);
				}
			}
		},
		error: function (data, status, e){
			alert(e);
		}
	})//end ajax
}*/
function submit_upload(){
	var num=$("#piclist .piclist_a").length;
	if(num==0){alert('你没有上传文件，无需保存');return false;}
}


	function deleteupload(num){
		$("#list"+num).remove();
	}
	
	function ajaxFileUpload(){
		var timestamp=Math.round(new Date().getTime()/1000) ;
		if($("#fileToUpload").val()==''){alert('请选择图片');return;}
		$.ajaxFileUpload({
				url:'model/doajaxfileupload.php',
				//url:'index.php?act=config&task=ajaxupload_action',
				secureuri:false,
				fileElementId:'fileToUpload',
				dataType: 'json',
				data:{name:'logan', id:'id'},
				success: function (data, status)
				{
					$("#waterurl").attr("src","../data/web_img/water.png?"+timestamp);
					$("#fileToUpload").val('');
					//var image=data.url;
				//alert(image);
				},
				error: function (data, status, e)
				{
					$("#waterurl").attr("src","../data/web_img/water.png?"+timestamp);
					$("#fileToUpload").val('');
				}
			}
		)
		
		return false;

	}